<?php
/**
 *  view: part view, presents list
 *  File: presents/presents_list.php
 */
?>


      <?php
      $present_cost = $this->config->item('present_cost'); 
      if( isset($presents) && count($presents)>0 )
      {
        foreach ($presents as $row)
        {
          $class_new = (0==$row->seen)?" new ":"";
          $name = ($row->name!="")?$row->name:$row->username;
          if( $row->image_name != NULL )            
             $image = "<img class='right' src='".base_url()."profile/image/thumb/{$row->from_id}/{$row->image_name}' alt='{$row->username}'>";            
           else
             $image = "<img class='right' src='".base_url()."img/no_photo.gif' alt=''>";
          
          if( $row->seen == 0 )
            $set_is_view = " onclick='setPresentIsView({$row->id})' ";
          else
            $set_is_view = "";          
           
          echo "
            <div class='notifications {$class_new}' id='present_{$row->id}'>              
              <a href='javascript:remove_present({$row->id})' class='delete-notif confirmLink' name='' title='".lang('remove_present')."' alt='".lang('confirm_remove_present')."' ></a>
              <a href='".base_url()."profile/view-profile/{$row->username}.htm'>{$image}<span class='name'>{$name} ".lang('is_send_present')."</span></a>
              <span class='time'>{$row->timestamp}</span><br/>
              <a href='".base_url()."presents/present-list.htm?name={$name}&to_id={$row->from_id}' class='present-back iframe' title='".sprintf(lang('send_present_back'),$present_cost)."' alt=''  >".sprintf(lang('send_present_back'),$present_cost)."</a>
              <a class='group1' href='".base_url()."img/presents/{$row->present}.png' title='' {$set_is_view} ><img class='presents-img' src='".base_url()."img/presents/thumb/{$row->present}.png' alt=''></a>
              <div class='clr'></div>
          </div><!--End notifications-->

            ";
        }
      }
      //<input class='delete-notif' name='' type='button'>
      ?>
        
        <div class="clr"></div>               
        <p id="contentspaginate" class="paginationstyle pagination" align="center">
					Página: <a href="#" rel="previous" class="imglinks"><<  </a> &nbsp; <span class="flatview"></span> &nbsp; <a href="#" rel="next"> >></a>
       </p>
       <script language='javascript' >
          var contents_home=new virtualpaginate({
              piececlass: "notifications",
              piececontainer: 'div', 
              pieces_per_page: 10,
              defaultpage: 0,
              wraparound: false,
              persist: false
          })

          contents_home.buildpagination(["contentspaginate"]);          
          
        </script>	
        <script src="<?php echo base_url(); ?>js/dialog.js"></script>